package com.scoresystem.dao.proxy;

import java.sql.Connection;
import java.util.List;

import com.scoresystem.dao.ISubjectDao;
import com.scoresystem.dao.impl.SubjectDaoImpl;
import com.scoresystem.model.Subject;
import com.scoresystem.utils.JdbcUtil;
/**
 * 
 * @author Administrator
 *SubjectDaoImpl 的静态代理类
 */
public class SubjectDaoProxy implements ISubjectDao {
	private ISubjectDao dao=null;
	private Connection conn=null;
	public SubjectDaoProxy()throws Exception{
		conn=JdbcUtil.getInstance().getConnection();
		dao=new SubjectDaoImpl(conn);
	}
	
	
	@Override
	public List<Subject> findAll() {
		List<Subject> list=dao.findAll();
		JdbcUtil.getInstance().free(conn);
		return list;
	}
	
}
